#ifndef __RTP_PACKET_H__
#define __RTP_PACKET_H__ 1

#include "audio_formats.h"
#include "routing/ip_packet.h"

struct rtphdr;

class CRTPPacket 
{
	public:
		virtual ~CRTPPacket();

		static const int sRTP_CSRC_FieldLength;
		static const int sRTP_Extension_FieldLength;
		static const int sRTP_Payload_Type_PCMU;
		static const int sRTP_Payload_Type_PCMA;
		static const int sRTP_Version;

		static CRTPPacket* createRTPPacket(CIPPacket* pIPPacket);
		static int destroyRTPPacket(CRTPPacket* pRTPPacket);

    virtual uint8_t* getPayload() const;
		virtual uint32_t getPayloadLength() const;
		virtual uint8_t getRTPVersion() const;
		virtual NAudioFormats::ECodec getPayloadType() const;
		virtual uint16_t getSequenceNumber() const;

		virtual uint8_t getRTPHeaderLength() const;

	private:
	 	CRTPPacket();
	 	CRTPPacket(CIPPacket* pIPPacket);
		CRTPPacket(const CRTPPacket& );
		CRTPPacket& operator=(const CRTPPacket& );

		static bool isRTPPacket(CIPPacket* pIPPacket);

		CIPPacket* mIPPacket;
		struct rtphdr* mRTPHeader;
		uint8_t* mPayload;
};

#endif /* __RTP_PACKET_H__ */
